Optimal. Leaf size=62 \[ -\frac {(c-d)^2 \cos (e+f x)}{a f (\sin (e+f x)+1)}+\frac {d x (2 c-d)}{a}-\frac {d^2 \cos (e+f x)}{a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2746, 2735, 2648} \[ -\frac {(c-d)^2 \cos (e+f x)}{a f (\sin (e+f x)+1)}+\frac {d x (2 c-d)}{a}-\frac {d^2 \cos (e+f x)}{a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2648
Rule 2735
Rule 2746
Rubi steps
\begin {align*} \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx &=-\frac {d^2 \cos (e+f x)}{a f}+\frac {\int \frac {a c^2+a (2 c-d) d \sin (e+f x)}{a+a \sin (e+f x)} \, dx}{a}\\ &=\frac {(2 c-d) d x}{a}-\frac {d^2 \cos (e+f x)}{a f}+(c-d)^2 \int \frac {1}{a+a \sin (e+f x)} \, dx\\ &=\frac {(2 c-d) d x}{a}-\frac {d^2 \cos (e+f x)}{a f}-\frac {(c-d)^2 \cos (e+f x)}{f (a+a \sin (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.46, size = 122, normalized size = 1.97 \[ -\frac {\left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right ) \left (\sin \left (\frac {1}{2} (e+f x)\right ) \left (-2 c^2-2 c d (e+f x-2)+d^2 (e+f x-2)+d^2 \cos (e+f x)\right )+d \cos \left (\frac {1}{2} (e+f x)\right ) (d \cos (e+f x)-(2 c-d) (e+f x))\right )}{a f (\sin (e+f x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.48, size = 142, normalized size = 2.29 \[ -\frac {d^{2} \cos \left (f x + e\right )^{2} - {\left (2 \, c d - d^{2}\right )} f x + c^{2} - 2 \, c d + d^{2} - {\left ({\left (2 \, c d - d^{2}\right )} f x - c^{2} + 2 \, c d - 2 \, d^{2}\right )} \cos \left (f x + e\right ) - {\left ({\left (2 \, c d - d^{2}\right )} f x - d^{2} \cos \left (f x + e\right ) + c^{2} - 2 \, c d + d^{2}\right )} \sin \left (f x + e\right )}{a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.15, size = 143, normalized size = 2.31 \[ \frac {\frac {{\left (2 \, c d - d^{2}\right )} {\left (f x + e\right )}}{a} - \frac {2 \, {\left (c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c^{2} - 2 \, c d + 2 \, d^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )} a}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.24, size = 140, normalized size = 2.26 \[ -\frac {2 d^{2}}{a f \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}+\frac {4 d \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) c}{a f}-\frac {2 \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) d^{2}}{a f}-\frac {2 c^{2}}{a f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}+\frac {4 c d}{a f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {2 d^{2}}{a f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.45, size = 209, normalized size = 3.37 \[ -\frac {2 \, {\left (d^{2} {\left (\frac {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 2}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {a \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a}\right )} - 2 \, c d {\left (\frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} + \frac {c^{2}}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.38, size = 124, normalized size = 2.00 \[ -\frac {d^2\,f\,x-2\,c\,d\,f\,x}{a\,f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,c^2-4\,c\,d+2\,d^2\right )-4\,c\,d+2\,c^2+4\,d^2+2\,d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left (a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 3.67, size = 940, normalized size = 15.16 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________